<template></template>

<script>
import Oidc from "oidc-client";
import router from "@/router"

let config = process.env.OIDC;
let mgr = new Oidc.UserManager(config);

new Oidc.UserManager()
  .signinRedirectCallback() //ids4的回调函数（返回一些基础的信息）
  .then(function(v) {
    console.log(v);
    sessionStorage.removeItem("UserName"); //用户名称
    sessionStorage.setItem("UserName", v.profile.UserName); //用户名称

    sessionStorage.removeItem("UserID"); //用户ID
    sessionStorage.setItem("UserID", v.profile.UserID); //用户ID

    sessionStorage.removeItem("URole"); //角色ID
    sessionStorage.setItem("URole", v.profile.URole); //角色ID

    sessionStorage.removeItem("superviseID"); //监管部门ID
    sessionStorage.setItem("superviseID", v.state); //监管部门ID

    // window.location = user.state;
    router.push({name:"list"})

  })
  .catch(function(e) {
    console.log(e);

  });
export default {};
</script>
